package com.heima.model.article.dots;

import com.heima.model.common.annotation.IdEncrypt;
import lombok.Data;

@Data
public class LikesBehaviorDto {
    @IdEncrypt
    private Long articleId;
    private Short operation;
    private Short type;
    public enum Operation{
        LIKE((short)0),
        CANCEL((short)1)
        ;
        private Short value;
        Operation(Short value)
        {
            this.value=value;
        }
        public Short getValue()
        {
            return this.value;
        }
        public static boolean check(Short value)
        {
            if (value==null)
                return false;
            if (value!= LIKE.getValue()&&value!= CANCEL.value)
                return false;
            return true;
        }

    }
    public enum Type{
        ARTICLE((short) 0),
        DYNAMIC((short)1),
        COMMENT((short)2);
        private Short value;
        Type(Short value)
        {
            this.value=value;
        }
        public Short getValue()
        {
            return this.value;
        }
    }
}
